
#include "Messi.h"
#include <string>
#include "ClassFromOtherFile.h"

namespace elloop_test {

	class DefinedInClass;
	class GrammarTest : public Messi {
	public:
		enum TEnum {Elem1, Elem2, Elem3, Elem_Length};
		GrammarTest() {}
		~GrammarTest() {}
		GrammarTest* run();
		void testPtr();
		void testDerivedDataField();


		void testCallMethodOutsideClass();
		void executeOuesideMethod(DefinedInClass * pExecuter);

        void testEnumFromClassDefinedInCppFile();


	private:
		static const std::string sc_mConstString;
		static const int s_mId;
	};

	class SimpleClass {
	public:
		int mData;
		std::string mDesc;
	public:
		SimpleClass(int data = 0, std::string desc="simple class") : mData(data), mDesc(desc) {

		}

		virtual ~SimpleClass() {}
		int getData() const { return mData; }
		std::string desc() const { return mDesc; }
		friend class GrammarTest;
	};

	class SimpleDerivedCalss : public SimpleClass {
	public:
		SimpleDerivedCalss(int data = 0, std::string desc="b3 bwin"): SimpleClass(data, desc) {

		}
	};

	class DefinedInClass {
	public:
		unsigned int mData;
		GrammarTest * mOwner;
		DefinedInClass(GrammarTest * owner, unsigned int data = 0) : mOwner(owner), mData(data) {}
		void callFromOutside() {
			int i1 = mData;
			i1 = i1;
		}
		void triggerCallOutside() {
			if (mOwner) {
				mOwner->executeOuesideMethod(this);
			}
		}
	};
}
